import Taro, {Component} from '@tarojs/taro'
import {View, Button, Text, Swiper, SwiperItem, Image, ScrollView} from '@tarojs/components'
import {connect} from '@tarojs/redux'
import {
  set_userinfo, set_cart, set_goodslist, set_viplist, set_bind_car_num, set_progress,
  set_pushdata, set_pushdatanum, gohome_btn, set_cart_num,
} from '../../actions/IndexAction'
import base from "../base"
import { AtTabs, AtTabsPane,AtTag } from 'taro-ui'
import './index.less'
import set from "../../apis/api"

class catch_list extends Component {
  constructor(props) {
    super(props)
    base(this)
    this.state = {
      current: 0,
    }
  }

  config = {
    navigationBarTitleText: '异常列表',
    enablePullDownRefresh: true,
    navigationBarBackgroundColor: "#4bb33d",
    navigationBarTextStyle: "white"

  }

  onReachBottom() {


  }


  componentWillReceiveProps(nextProps) {
    console.log(this.props, nextProps)
  }

  onPullDownRefresh() {
    wx.stopPullDownRefresh();
  }

  componentWillUnmount() {
  }

  componentDidShow() {
    this.onPullDownRefresh()


  }

  back() {
    Taro.navigateBack()
  }

  fetchData() {


    // wx.showLoading({title: "加载中"})
    // var databody={
    //   openid:this.props.wxuser.wxuser.openid,
    //   id:this.$router.params.id
    // }
    // this.wx_request(set.oto.getotoorder, databody,"POST", {'Content-Type': 'application/x-www-form-urlencoded'}).then((data)=>
    // {
    //
    //
    //   wx.stopPullDownRefresh();
    //   wx.hideLoading();
    //
    // }).catch((err)=>{
    //   wx.hideLoading();
    //   wx.stopPullDownRefresh();
    //   wx.showToast({
    //     title: '网络访问失败，请重试',
    //     icon: 'none',
    //     duration: 1800
    //   })
    // })

  }

  componentDidHide() {
  }

  render() {
    const tabList = [{ title: '未处理' }, { title: '已处理' }]
    return (
      <View>
        <View>
          <ScrollView>
            <AtTabs current={this.state.current} tabList={tabList} >
              <AtTabsPane current={this.state.current} index={0} >
                <View style={{padding:"10rpx",background:"#f0f2f5",display:"flex",flexDirection:"column"}}>
                    <View style={{background:"#ffffff",margin:"10rpx",borderRadius:"20rpx",overflow:"hidden",padding:"10rpx",display:"flex"}}>
                      <View style={{padding:"20rpx",display:"flex",alignItems:"center",justifyContent:"center"}}>
                        <Image src={"../../assets/images/icon_18.png"} style={{width:"80rpx"}} mode={"widthFix"}/>

                      </View>
                      <View style={{width:"flex:1"}}>
                        <View style={{display:"flex",flex:1}}>
                          <View style={{display:"flex",flex:1,padding:"10rpx"}}>
                            <View style={{width:"160rpx",height:"40rpx",borderRadius:"20rpx",backgroundColor:"#ae5da0",  alignItems: "center",
                              justifyContent: "center",display:"flex",flex:1}}>
                              <Text style={{color: "#ffffff", fontSize: "22rpx"}}>直流电压</Text>
                            </View>
                            <View style={{height:"40rpx",borderRadius:"20rpx",width:"60rpx",  alignItems: "center",
                              justifyContent: "center",display:"flex",    paddingLeft: "20rpx",
                              paddingRight: "20rpx",}}>
                              <Text style={{color: "#333333", fontSize: "22rpx"}}>231V</Text>
                            </View>


                          </View>
                          <View style={{display:"flex",flex:1,padding:"10rpx"}}>
                            <View style={{width:"160rpx",height:"40rpx",borderRadius:"20rpx",backgroundColor:"#ae5da0",  alignItems: "center",
                              justifyContent: "center",display:"flex",flex:1}}>
                              <Text style={{color: "#ffffff", fontSize: "22rpx"}}>直流电压</Text>
                            </View>
                            <View style={{height:"40rpx",borderRadius:"20rpx",width:"60rpx",  alignItems: "center",
                              justifyContent: "center",display:"flex",    paddingLeft: "20rpx",
                              paddingRight: "20rpx",}}>
                              <Text style={{color: "#333333", fontSize: "22rpx"}}>231V</Text>
                            </View>


                          </View>
                        </View>
                        <View style={{display:"flex",flex:1}}>
                          <View style={{display:"flex",flex:1,padding:"10rpx"}}>
                            <View style={{width:"160rpx",height:"40rpx",borderRadius:"20rpx",backgroundColor:"#ae5da0",  alignItems: "center",
                              justifyContent: "center",display:"flex"}}>
                              <Text style={{color: "#ffffff", fontSize: "22rpx"}}>直流电压</Text>
                            </View>

                          </View>


                        </View>
                        <View style={{display:"flex",flex:1}}>
                            <View style={{border:"1px solid #f0f2f5",borderRadius:"10rpx",padding:"10rpx",flex:1,height:"60rpx"}}>
222
                            </View>
                        </View>
                        <View style={{display:"flex",flex:1}}>
                          <View style={{height:"40rpx", alignItems: "center",
                            justifyContent: "center",display:"flex"}}>
                            <Text style={{color: "#999999", fontSize: "22rpx"}}>创建时间:xxxxxxx</Text>
                          </View>


                        </View>
                        <View style={{display:"flex",flex:1}}>
                          <View style={{display:"flex",flex:1,justifyContent:"flex-end"}}>
                            <View style={{width:"160rpx",height:"50rpx",borderRadius:"25rpx",backgroundColor:"#ae5da0",  alignItems: "center",
                              justifyContent: "center",display:"flex",margin:"10rpx"}}>
                              <Text style={{color: "#ffffff", fontSize: "22rpx"}}>直流电压</Text>
                            </View>
                            <View style={{width:"160rpx",height:"50rpx",borderRadius:"25rpx",backgroundColor:"#ae5da0",  alignItems: "center",
                              justifyContent: "center",display:"flex",margin:"10rpx"}}>
                              <Text style={{color: "#ffffff", fontSize: "22rpx"}}>直流电压</Text>
                            </View>
                          </View>


                        </View>
                      </View>
                    </View>
                  <View style={{background:"#ffffff",margin:"10rpx",borderRadius:"20rpx",overflow:"hidden",padding:"10rpx",display:"flex"}}>
                    <View style={{padding:"20rpx",display:"flex",alignItems:"center",justifyContent:"center"}}>
                      <Image src={"../../assets/images/icon_18.png"} style={{width:"80rpx"}} mode={"widthFix"}/>

                    </View>
                    <View style={{width:"flex:1"}}>
                      <View style={{display:"flex",flex:1}}>
                        <View style={{display:"flex",flex:1,padding:"10rpx"}}>
                          <View style={{width:"160rpx",height:"40rpx",borderRadius:"20rpx",backgroundColor:"#ae5da0",  alignItems: "center",
                            justifyContent: "center",display:"flex",flex:1}}>
                            <Text style={{color: "#ffffff", fontSize: "22rpx"}}>直流电压</Text>
                          </View>
                          <View style={{height:"40rpx",borderRadius:"20rpx",width:"60rpx",  alignItems: "center",
                            justifyContent: "center",display:"flex",    paddingLeft: "20rpx",
                            paddingRight: "20rpx",}}>
                            <Text style={{color: "#333333", fontSize: "22rpx"}}>231V</Text>
                          </View>


                        </View>
                        <View style={{display:"flex",flex:1,padding:"10rpx"}}>
                          <View style={{width:"160rpx",height:"40rpx",borderRadius:"20rpx",backgroundColor:"#ae5da0",  alignItems: "center",
                            justifyContent: "center",display:"flex",flex:1}}>
                            <Text style={{color: "#ffffff", fontSize: "22rpx"}}>直流电压</Text>
                          </View>
                          <View style={{height:"40rpx",borderRadius:"20rpx",width:"60rpx",  alignItems: "center",
                            justifyContent: "center",display:"flex",    paddingLeft: "20rpx",
                            paddingRight: "20rpx",}}>
                            <Text style={{color: "#333333", fontSize: "22rpx"}}>231V</Text>
                          </View>


                        </View>
                      </View>
                      <View style={{display:"flex",flex:1}}>
                        <View style={{display:"flex",flex:1,padding:"10rpx"}}>
                          <View style={{width:"160rpx",height:"40rpx",borderRadius:"20rpx",backgroundColor:"#ae5da0",  alignItems: "center",
                            justifyContent: "center",display:"flex"}}>
                            <Text style={{color: "#ffffff", fontSize: "22rpx"}}>直流电压</Text>
                          </View>

                        </View>


                      </View>
                      <View style={{display:"flex",flex:1}}>
                        <View style={{border:"1px solid #f0f2f5",borderRadius:"10rpx",padding:"10rpx",flex:1,height:"60rpx"}}>
                          222
                        </View>
                      </View>
                      <View style={{display:"flex",flex:1}}>
                        <View style={{height:"40rpx", alignItems: "center",
                          justifyContent: "center",display:"flex"}}>
                          <Text style={{color: "#999999", fontSize: "22rpx"}}>创建时间:xxxxxxx</Text>
                        </View>


                      </View>
                      <View style={{display:"flex",flex:1}}>
                        <View style={{display:"flex",flex:1,justifyContent:"flex-end"}}>
                          <View style={{width:"160rpx",height:"50rpx",borderRadius:"25rpx",backgroundColor:"#ae5da0",  alignItems: "center",
                            justifyContent: "center",display:"flex",margin:"10rpx"}}>
                            <Text style={{color: "#ffffff", fontSize: "22rpx"}}>直流电压</Text>
                          </View>
                          <View style={{width:"160rpx",height:"50rpx",borderRadius:"25rpx",backgroundColor:"#ae5da0",  alignItems: "center",
                            justifyContent: "center",display:"flex",margin:"10rpx"}}>
                            <Text style={{color: "#ffffff", fontSize: "22rpx"}}>直流电压</Text>
                          </View>
                        </View>


                      </View>
                    </View>
                  </View>
                  <View style={{background:"#ffffff",margin:"10rpx",borderRadius:"20rpx",overflow:"hidden",padding:"10rpx",display:"flex"}}>
                    <View style={{padding:"20rpx",display:"flex",alignItems:"center",justifyContent:"center"}}>
                      <Image src={"../../assets/images/icon_18.png"} style={{width:"80rpx"}} mode={"widthFix"}/>

                    </View>
                    <View style={{width:"flex:1"}}>
                      <View style={{display:"flex",flex:1}}>
                        <View style={{display:"flex",flex:1,padding:"10rpx"}}>
                          <View style={{width:"160rpx",height:"40rpx",borderRadius:"20rpx",backgroundColor:"#ae5da0",  alignItems: "center",
                            justifyContent: "center",display:"flex",flex:1}}>
                            <Text style={{color: "#ffffff", fontSize: "22rpx"}}>直流电压</Text>
                          </View>
                          <View style={{height:"40rpx",borderRadius:"20rpx",width:"60rpx",  alignItems: "center",
                            justifyContent: "center",display:"flex",    paddingLeft: "20rpx",
                            paddingRight: "20rpx",}}>
                            <Text style={{color: "#333333", fontSize: "22rpx"}}>231V</Text>
                          </View>


                        </View>
                        <View style={{display:"flex",flex:1,padding:"10rpx"}}>
                          <View style={{width:"160rpx",height:"40rpx",borderRadius:"20rpx",backgroundColor:"#ae5da0",  alignItems: "center",
                            justifyContent: "center",display:"flex",flex:1}}>
                            <Text style={{color: "#ffffff", fontSize: "22rpx"}}>直流电压</Text>
                          </View>
                          <View style={{height:"40rpx",borderRadius:"20rpx",width:"60rpx",  alignItems: "center",
                            justifyContent: "center",display:"flex",    paddingLeft: "20rpx",
                            paddingRight: "20rpx",}}>
                            <Text style={{color: "#333333", fontSize: "22rpx"}}>231V</Text>
                          </View>


                        </View>
                      </View>
                      <View style={{display:"flex",flex:1}}>
                        <View style={{display:"flex",flex:1,padding:"10rpx"}}>
                          <View style={{width:"160rpx",height:"40rpx",borderRadius:"20rpx",backgroundColor:"#ae5da0",  alignItems: "center",
                            justifyContent: "center",display:"flex"}}>
                            <Text style={{color: "#ffffff", fontSize: "22rpx"}}>直流电压</Text>
                          </View>

                        </View>


                      </View>
                      <View style={{display:"flex",flex:1}}>
                        <View style={{border:"1px solid #f0f2f5",borderRadius:"10rpx",padding:"10rpx",flex:1,height:"60rpx"}}>
                          222
                        </View>
                      </View>
                      <View style={{display:"flex",flex:1}}>
                        <View style={{height:"40rpx", alignItems: "center",
                          justifyContent: "center",display:"flex"}}>
                          <Text style={{color: "#999999", fontSize: "22rpx"}}>创建时间:xxxxxxx</Text>
                        </View>


                      </View>
                      <View style={{display:"flex",flex:1}}>
                        <View style={{display:"flex",flex:1,justifyContent:"flex-end"}}>
                          <View style={{width:"160rpx",height:"50rpx",borderRadius:"25rpx",backgroundColor:"#ae5da0",  alignItems: "center",
                            justifyContent: "center",display:"flex",margin:"10rpx"}}>
                            <Text style={{color: "#ffffff", fontSize: "22rpx"}}>直流电压</Text>
                          </View>
                          <View style={{width:"160rpx",height:"50rpx",borderRadius:"25rpx",backgroundColor:"#ae5da0",  alignItems: "center",
                            justifyContent: "center",display:"flex",margin:"10rpx"}}>
                            <Text style={{color: "#ffffff", fontSize: "22rpx"}}>直流电压</Text>
                          </View>
                        </View>


                      </View>
                    </View>
                  </View>
                </View>
              </AtTabsPane>
              <AtTabsPane current={this.state.current} index={1}>



              </AtTabsPane>

            </AtTabs>
          </ScrollView>
        </View>
      </View>
    )
  }
}

const mapstate = state => {
  return {
    userinfo: state.usermodel,
    cart_num: state.cart_num,
    cart: state.cart,
    goodslist: state.goodslist,
    vip: state.vip,
    progress: state.progress,
    pushdata: state.pushdata,
    wxuser: state.wxusermodel,sys_config:state.sys_config
  }
}
export default connect(mapstate)(catch_list)

